package qc.module.cms.mapper;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import qc.module.cms.dto.securityledger.SecurityLedgerDto;
import qc.module.cms.entity.SecurityLedger;

import java.util.List;

/**
 * SecurityLedgerMapper
 *
 * @author QuCheng Tech
 * @since 2023/12/26
 */
@Mapper
public interface SecurityLedgerMapper {
    SecurityLedgerMapper MAPPER = Mappers.getMapper(SecurityLedgerMapper.class);

    @Mapping(target = "tm", source = "tm", dateFormat = "yyyy-MM-dd")
    SecurityLedger toEntity(SecurityLedgerDto dto);

    @Mapping(target = "tm", source = "tm", dateFormat = "yyyy-MM-dd")
    SecurityLedgerDto toDto(SecurityLedger en);

    List<SecurityLedgerDto> toDtoList(List<SecurityLedger> list);
}
